<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<h2>post用户注册</h2><h3></h3>
		<input type="text" placeholder="请输入用户名" />
		<script type="text/javascript">
			var but = document.querySelector('input');
			//失去焦点事件
			but.onblur = function(){
				var xhr = new XMLHttpRequest();
				xhr.open('get','http://php.weather.sina.com.cn/iframe/index/w_cl.php');
				xhr.onload = function(){
					console.log(xhr.responseText);
					document.querySelector('h3').innerHTML = xhr.responseText;
				}
				xhr.send(null);
			}
		</script>
	</body>
</html>
